This page last changed on Jul 24, 2008 by stepheneb.
if you just want a local jnlp server do not follow these directions, instead go to Setup Local Jnlp Server

These instructions provide a way to install jars into the jnlp cache from a local server.
This can be used to do a CD or USB stick install of webstart based software.

SAIL Dashboard scripts

UDL SAIL Dashboard MacOS disk image archive.

I've created a disk image that has the MacOS shell scripts and Java Web Start resources that can be used to manually install all the Java Web Start resources used for the UDL activities.

Here's a copy of the script: /home/sbannasch/scripts/sds-empty I use to create an empty sail dashboard dmg on the server seymour and copy it to http://rails.dev.concord.org

#!/bin/bash
rm -rf sd
mkdir sd
cd sd
svn export https://svn.concord.org/svn/projects/trunk/common/java/deploy/sail-dashboard
echo '' > sail-dashboard/commands/jnlps.txt
cd -
/home/sbannasch/bin/make_dmg sd sail-dashboard-empty.dmg "SAILDashboard"
scp sail-dashboard-empty.dmg  sbannasch@otto.concord.org:~/rails

Here's a copy of the make_dmg script it calls:

#!/bin/bash
#
# make_dmg
#
# make hfsplus disk image from directory
#
# sudo make_dmg <dir_path> <dmg_nameg> [volume_label]
#

if [ -z "$SUDO_COMMAND" ]   # Need to run this with sudo 
then 
   mntusr=$(id -u) grpusr=$(id -g) sudo $0 $* 
   exit 0 
fi 
if [ -d "$1" ]              # dir_path 
then 
 dir_path=$1
else
  echo "Must pass in valid dir" 
  exit 
fi
if [ -n "$2" ]              # dmg_name
then 
 dmg_name=$2
else
  echo "Must pass name for dmg" 
  exit 
fi
if [ -n "$3" ]              # volume_label. 
then 
 volume_label=$3
else
  volume_label="Untitled"
  echo
  echo "Using volume_label=Untitled" 
  echo
fi
du_output=`du -sk $dir_path 2>&1`
dir_size=`echo $du_output | cut -f1 -d" "`
dir_size=`expr $dir_size + 1000` 
dd if=/dev/zero of=$dmg_name bs=1024 count=$dir_size
/sbin/mkfs.hfsplus -v "$volume_label" $dmg_name
mount -o loop -t hfsplus ./$dmg_name /mnt/tmp/
cp -r $dir_path/* /mnt/tmp
umount /mnt/tmp

Here's a pdf of the the initial user documentation for UDL Teachers UsingSailDashboard_v1.1.pdf.

This disk image is an empty SAIL Dashboard with the two jnlps used by the current UDL project in the file: commands/jnlps.txt.

The disk image only 5MB, so after downloading you will need to run this command:

  • update_cached_resources_from_remote_servers

to fill the SAIL Dashboard cache with the web start resources for the jnlps listed in the file commands/jnlps.txt.

After you download it the SAIL Dashboard volume should mount.

Contained in the SAIL Dashboard volume is a folder called: sail-dashboard

Copy that to a USB stick or a portable hard drive and fill the SAIL Dashboard cache with the remote Java Web Start resources with this command:

  • update_cached_resources_from_remote_servers

Then mount the portable drive on any MacOS computer that needs the UDL Java Web Start resources installed and then double click this script file in the sail-dashboard folder:

  • copy_resources_to_local_webstart_cache.command

FYI (background info):

These are the jnlps whose jars the sail-dashboard-udl.dmg will be populated with:

http://jnlp.concord.org/dev/org/concord/maven-jnlp/udl-otrunk/udl-otrunk-0.1.0-20080507.121247.jnlp
http://jnlp.concord.org/dev/mozswing/mozswing.jnlp

Empty SAIL Dashboard MacOS disk image archive.

There is also an empty sail-dashboard.dmg (only 3.5MB) located here:

Right now this only works on Macs ... the scripts could certainly be adapted for Windows however.

Download it, copy the sail-dashboard folder to another volume and add one or more jnlp urls in the file: sail-dashboard/commands/jnlps.txt.

With a TELS Jnlp url then you could use this script to install into the SAIL Dashboard cache the jnlp resources for a TELS run:

  • update_cached_resources_from_remote_servers

Copy the sail-dashboard folder to a portable hard drive or a USB stick and it can be used to preload the TELS jars onto classroom computers that don't already have the jars.

SAIL Dashboard Code Resources:

We are using the script listed here: Creating MacOS dmg files in Linux to script the production of MacOS dmg files on our Linux servers.

Creating MacOS Disk Images:

The MacOS command line utility: hdutils can be used in a shell script to create a MacOS Disk Image of the sail-dashboard folder.

In order for a MacOS disk image to mount with the sail-dashboard folder appearing in the mounted volume a copy of the sail-dashboard folder should be place inside another folder.

Creating an empty SAIL Dashboard Disk Image
mkdir sd
cd sd
svn export https://svn.concord.org/svn/projects/trunk/common/java/deploy/sail-dashboard
cd -
hdiutil create -srcfolder sd -fs HFS+ -volname SAIL\ Dashboard sail-dashboard-empty.dmg
Creating a SAIL Dashboard Disk Image with the Jetty jnlp servlet cache pre-filled.

After completing a svn export of sail-dashboard code edit the file: sail-dashboard/commands/jnlp.txt to include the Jnlp url(s) you would like the SAIL Dashboard to cache.

cd sd/sail-dashboard
./update_cached_resources_from_remote_servers.command
cd -
hdiutil create -srcfolder sd -fs HFS+ -volname SAIL\ Dashboard sail-dashboard.dmg

SAIL Dashboard README

README

These scripts can be used to pre-load the Java Web Start jar files for a Jnlp into a local users Java Web Start cache.

The folder containing these scripts and cached Jar files can be copied to a USB Flash memory stick or a portable hard drive and moved from computer to computer in a classroom to quickly preload the Java Web Start cache for the local user on each computer.

Currently these scripts only work on MacOS X

The file: commands/jnlps.txt, has a list of all the Java Web Start Jnlps that will be cached locally by the SAIL Dashboard. These are normally copies of the Jnlp urls used by the SAIL Data Service.

How to use the SAIL Dashboard Scripts:

  1. Cache the Java jar files used for a Jnlp into the SAIL Dashboard Cache
    This command normally only needs to be done once.
    To run directly from the Finder double-click the file:
    • update_cached_resources_from_remote_servers.command
      This script downloads from the Internet all the Java Web Start Jars used by the Jnlp files listed in the file: commands/jnlps.txt. If you add a new Jnlp to the file: commands/jnlps.txt or you suspect that the Jars the Jnlp references have been updated you will need to run this script again.
      Make sure you are on a reasonably fast Internet connection when you run this script.
      The Jnlp resources will be cached in the directory:
    • sail-dashboard/jetty/jetty-6.1.9-stripped/webapps/jnlp
  2. Copy the Java Web Start jar files cached in the SAIL Dashboard into the local Java Web Start cache directory.
    This script command will copy all the Jnlp resources in the SAIL Dashboard Cache into the Java Web Start Cache for the user that is running this command.
    To run directly from the Finder double-click the file:
    • copy_resources_to_local_webstart_cache.command

Initial Design Work

The procedure would go like this:

  • a developer follows the first 2 sections to setup the CD or USB stick.
  • the developer makes a shell script or .bat file to automate the last section.
  • a user can then just run the shell script or .bat file

This process uses the "-import" option built into javaws. That is documented here
But that documentation does not address how to do the "import" when versioned jars are being used. So the procedure below describes how use the "-import" option with versioned jars.

Install Empty Jnlp Server

curl http://confluence.concord.org/download/attachments/15581/jetty-6.1.9-stripped.zip | jar x 
mkdir jetty-6.1.9-stripped/webapps/jnlp 
cd jetty-6.1.9-stripped/webapps/jnlp 
curl http://confluence.concord.org/download/attachments/11547/empty-jnlp-servlet.war | jar x 
cd - 

Update Jars and Jnlps in Jnlp Server

curl http://jnlp.concord.org/dev/org/concord/jnlp2shell/jnlp2shell-1.0-SNAPSHOT.jar > jnlp2shell.jar 
SERVLET_JNLPS=" 
  http://jnlp.concord.org/dev/org/concord/maven-jnlp/udl-otrunk/udl-otrunk.jnlp  
  http://jnlp.concord.org/dev/org/concord/maven-jnlp/capa-otrunk/capa-otrunk.jnlp" 
for jnlp_url in $SERVLET_JNLPS 
do  
  java -Dgenerate.import.jnlps=true -cp jnlp2shell.jar org.concord.JnlpServletCacher $jnlp_url jetty-6.1.9-stripped/webapps/jnlp 
done 

this is a slightly modified version of the script on Setup Local Jnlp Server. The difference is the "-Dgenerate.import.jnlps=true".
This leaves the original codebase in the jnlp files, and removes a href attribute if they have one. This is necessary for the javaws -import command to work.

Install/Import Jars into Webstart Cache

Start the server

cd jetty-6.1.9-stripped 
java -jar start.jar etc/jetty.xml 

Have javaws do the import

javaws -codebase [local codebase] -import [url to local jnlp file]

The best way to figure out the appropriate codebase is to look at the jnlp file you are trying to import. Then replace

[host]:[port]/[context]

with

localhost:8080/jnlp
Examples
javaws -codebase http://localhost:8080/jnlp -import http://localhost:8080/jnlp/org/concord/maven-jnlp/udl-otrunk/udl-otrunk.jnlp
javaws -codebase http://localhost:8080/jnlp/mozswing -import http://localhost:8080/jnlp/mozswing/mozswing.jnlp

Stop the server

type ctrl-c


UsingSailDashboard_v1.1.pdf (application/pdf)
Document generated by Confluence on Jan 27, 2014 16:56